package com.jvm.interpreter.instruction;

import com.jvm.interpreter.Frame;
import com.jvm.interpreter.Instruction;

/**
 * @program: diy_simple_jvm
 * @description: istroe_0指令
 * @author: CaoYong
 * @create: 2021-07-08 10:18
 **/
public class IStore0Inst implements Instruction {

    /**
     * 将当前栈帧的操作数栈的栈顶数据弹出并存放到本地变量表0的位置
     * @param frame 栈帧
     */
    @Override
    public void eval(Frame frame) {
//        frame.localVars.put(0, frame.operandStack.pop());
        frame.setInt(1, frame.popInt());
        frame.pc += offset();
    }
}
